import React, { Component } from 'react'
// import Leftson from './leftson'
class Left extends Component {
  state = {
      flag:true,
      age:20
  }
  fn(){
      this.setState({
          flag:!this.state.flag
      })
  }
  checkage(){
      this.setState({
          age:30
      })
  }
  render() {
    let {age} = this.state // this.state.age
    return (
      <div>
          <button onClick={this.checkage.bind(this)}>点击我去修改age</button>
          <button onClick={()=>{this.setState({flag:false})}}>点击我创建或者删除子组件</button>
          {/* {
              this.state.flag? <Leftson send={age}></Leftson>:""
          } */}
         
      </div>
    )
  }
}

export default Left